export default async function() {
  // 获取现在渠道
  let url = location.href.split("#")[1];
  let params = await getQueryParams(url);
  if (params && params.channel) {
    uni.setStorageSync('channel', params.channel);
  }else{
    uni.setStorageSync('channel', 0);
  }
}
function getQueryParams(url) {
    const paramArr = url.slice(url.indexOf("?") + 1).split("&");
    const params = {};
    paramArr.map((param) => {
        const [key, val] = param.split("=");
        params[key] = decodeURIComponent(val);
    });
    return params;
}